package chapter7.HashSet;

import java.util.*;
public class Example {
    public static void main(String[] args) {
        Set<Person> hashSet = new HashSet<Person>();
        hashSet.add(new Person("马先生", 181));
        hashSet.add(new Person("李先生", 186));
        hashSet.add(new Person("王小姐", 193));
        Iterator<Person> it = hashSet.iterator();
        while (it.hasNext()) {
            Person person = it.next();
            System.out.println(person.getName() + " " + person.getId_card());
        }
    }
}